package student.aistar.proxy.demo02;

import java.lang.reflect.Proxy;

public class TestTeacherDao {
    public static void main(String[] args) {
        ITeacherDao teacherDao = new TeacherDaoImpl();
        ProxyHandler proxyHandler = new ProxyHandler(teacherDao);

        ITeacherDao iTeacherDao = (ITeacherDao) Proxy.newProxyInstance(teacherDao.getClass().getClassLoader(), teacherDao.getClass().getInterfaces(),
                proxyHandler);
        System.out.println(teacherDao.getClass().getInterfaces()+"=======");
        System.out.println(iTeacherDao.getClass());
        iTeacherDao.save();
    }
}

